package com.heima.test3;

public class MathUtils {
    public static int add(int... number){
        int sum=0;
        for (int i : number) {
            sum+=i;
        }
        return sum;
    }
    public static int subtract(int... number){
        int sum=number[0];
        for (int i = 1; i < number.length; i++) {
            sum-=number[i];
        }
        return sum;
    }
    public static int multiply(int... number){
        int sum=1;
        for (int i : number) {
            sum*=i;
        }
        return sum;
    }
    public static double divide(int... number){
        int sum=number[0];
        for (int i = 1; i < number.length; i++) {
            sum/=number[i];
        }
        return sum;
    }
}
